<style>
  table, th, tr, td {
    border: 1px solid #ccc;
    font-size: 14px;
  }
  .ordertable{
    width: 95%;
    margin: 0 auto;
    border-radius: 10px;
  }
  .tablebox1{
    padding-top: 10px;
  }
  .payorder{
    display: flex;
    justify-content: center;
    height: 50px;
    line-height: 40px;
    font-size: 18px;
  }
  .paygoods{
    display: flex;
    justify-content: center;
    height: 50px;
    line-height: 40px;
    font-size: 18px;
  }
  .ordertable tr td{
    line-height: 30px;
    text-align: center;
  }
</style>
<script src="../../static/js/jquery-3.1.1.min.js"></script>
<div class="layuimini-container">
  <div class="tablebox">
    <div class="payorder">基本信息</div>
    <table class="ordertable">
      <tr>
        <td style="width: 15%;">订单编号：</td>
        <td style="width: 15%;">{$row.ordersn}</td>
        <td style="width: 20%">下单时间：</td>
        <td style="width: 20%">{$row.create_time|date='Y-m-d H:i:s'}</td>
        <td style="width: 15%;">下单用户：</td>
        <td style="width: 15%;">{$row.nickName}</td>
      </tr>
      <tr>
        <td style="width: 15%;">微信标识：</td>
        <td style="width: 15%;">{$row.openid}</td>
        <td style="width: 20%">收货人姓名：</td>
        <td style="width: 20%;">{$row.realname}</td>
        <td style="width: 15%;">收货电话：</td>
        <td style="width: 15%;">{$row.mobile}</td>
      </tr>
      <tr>
        <td style="width: 15%;">收货方式：</td>
        <td style="width: 25%;" colspan="2">{if condition="$row['shippingtype']==1"}商家邮寄{else/}到店核销{/if}</td>
        <td style="width: 15%">详细地址：</td>
        <td style="width: 25%;" colspan="2">{$row.address}</td>
      </tr>
      <tr>
        <td style="width: 15%;">订单状态：</td>
        <td style="width: 15%;">{$row.statusname}</td>
        <td style="width: 20%;">支付时间：</td>
        <td style="width: 20%;">{if condition="$row['paytime'] neq ''"}{$row.paytime|date='Y-m-d H:i:s'}{else/}--{/if}</td>
        <td style="width: 15%;">发货时间：</td>
        <td style="width: 15%;">{if condition="$row['shipping_time'] neq ''"}{$row.shipping_time|date='Y-m-d H:i:s'}{else/}--{/if}</td>
      </tr>
      <tr>
        <td style="width: 15%;">收货时间：</td>
        <td style="width: 15%;">{if condition="$row['confirm_time'] neq ''"}{$row.confirm_time|date='Y-m-d H:i:s'}{else/}--{/if}</td>
        <td style="width: 20%;">取消时间：</td>
        <td colspan="3">{if condition="$row['canseltime'] neq ''"}{$row.canseltime|date='Y-m-d H:i:s'}{else/}--{/if}</td>
      </tr>
    </table>
  </div>
  <div class="tablebox1">
    <div class="paygoods">购买商品</div>
    <table class="ordertable" style="padding-top: 10px;">
      <tr>
        <td style="width: 20%;">商品名称</td>
        <td style="width: 20%;">图片</td>
        <td style="width: 20%">商品价格</td>
        <td style="width: 20%">购买数量</td>
      </tr>
      {foreach name="goodslist" item="val"}
      <tr>
        <td style="width: 20%;">{$val.goods_name}</td>
        <td style="width: 20%;"><img src="{$val.image}" style="padding: 10px;" width="100" height="100"></td>
        <td style="width: 20%">￥{$val.price}</td>
        <td style="width: 20%">X{$val.total}</td>
      </tr>
      {/foreach}
      <tr>
        <td style="width: 20%;">商品合计：</td>
        <td colspan="5">￥{$row.orderprice}</td>
      </tr>
      <tr>
        <td style="width: 20%;">运费金额：</td>
        <td colspan="5">￥{$row.shippingfee}</td>
      </tr>
      <tr>
        <td style="width: 20%;">折扣金额：</td>
        <td colspan="5">￥{$row.discountprice}</td>
      </tr>
      <tr>
        <td style="width: 20%;">应付金额：</td>
        <td colspan="5">￥{$row.payprice}</td>
      </tr>
    </table>
  </div>
  <div class="hr-line"></div>
  <form id="app-form" class="layui-form layuimini-form">
    <div class="hr-line"></div>
    <div id="shippingbox" style="display: none;">
      <div class="layui-form-item">
        <label class="layui-form-label">快递名称</label>
        <div class="layui-input-block">
          <input type="text" name="express" class="layui-input" placeholder="请输入快递名称" value="">
        </div>
      </div>
      <div class="layui-form-item">
        <label class="layui-form-label">快递公司</label>
        <div class="layui-input-block">
          <input type="text" name="expresscom" class="layui-input" placeholder="请输入快递公司" value="">
        </div>
      </div>
      <div class="layui-form-item">
        <label class="layui-form-label">快递单号</label>
        <div class="layui-input-block">
          <input type="text" name="expresssn" class="layui-input" placeholder="请输入快递单号" value="">
        </div>
      </div>
    </div>
    <div class="layui-form-item text-center">
      {if condition="$row['orderstatus'] == 0"}
      <input type="hidden" name="orderToStatus" value="1">
      <button type="submit" class="layui-btn layui-btn-normal layui-btn-sm" lay-submit>确认付款</button>
      {/if}
      {if condition="$row['orderstatus'] == 1"}
      <input type="hidden" name="orderToStatus" value="2">
      <button type="button" onclick="doshipping(this)" id="shippingdothis" class="layui-btn layui-btn-normal layui-btn-sm">确认发货</button>
      <button type="submit" id="realsumit"  style="display: none" class="layui-btn layui-btn-normal layui-btn-sm" lay-submit>确认发货</button>
      {/if}
      {if condition="$row['orderstatus'] == 2"}
      <input type="hidden" name="orderToStatus" value="3">
      <button type="submit" class="layui-btn layui-btn-normal layui-btn-sm" lay-submit>确认收货</button>
      {/if}
    </div>
  </form>
</div>
<script>
  function doshipping(){
    $("#shippingbox").show();
    $("#shippingdothis").hide();
    $('#realsumit').show();
  }
</script>